package common

import "errors"

var (
	ErrHandshakeFailed   = errors.New("websocket handshake failed")                       // 握手失败
	ErrMaskRequired      = errors.New("client frame must be masked")                      // 客户端发送的帧没有掩码
	ErrUnsupportedOpcode = errors.New("unsupported opcode")                               // 不支持的 opcode
	ErrCloseSent         = errors.New("close frame already sent")                         // 关闭帧已发送，不能再发送帧
	ErrPayloadTooLarge   = errors.New("websocket: payload length exceeds system maximum") // 负载长度太长，超过了本系统的 int 最大值
	ErrInvalidFragment   = errors.New("invalid fragment sequence")                        // 分片序列无效（如首帧为Continuation）
	ErrAssemblerClosed   = errors.New("message assembler closed")                         // 组装器已关闭
	ErrInvalidScheme     = errors.New("invalid WebSocket scheme (must be ws or wss)")     // 非法 WebSocket 协议
	ErrSendBufferFull    = errors.New("send buffer full")                                 // 发送缓冲区已满
	ErrNotConnected      = errors.New("not connected")                                    // 未建立连接
)
